package org.jtsmix.editor;

import org.jtsmix.mixfile.GameType;
import org.jtsmix.mixfile.MixFileIndexEntry;
import org.jtsmix.mixfile.MixInfo;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.List;

/**
 * this class is used for read only (safe) operations. Use MixEditor instead
 * to edit mix archive.
 *
 * @author ivosh
 */
public interface MixReader {

    /**
     * open a mix archive
     * <p/>
     * This action needs to be done before any action on archive is performed.
     *
     * @param fileName
     * @throws FileNotFoundException
     * @throws IOException
     */
    public void open(String fileName, GameType gameType) throws FileNotFoundException, IOException;

    /**
     * read a file from archive and write it to disk
     *
     * @param fileToExtract  name of contained file
     * @param outputFileName path where to extract the file
     */
    public void extract(String fileToExtract, String outputFileName);

    /**
     * extracts all the files to specified directory
     *
     * @param outputDirectory
     */
    public void extractAll(String outputDirectory);

    public boolean contains(String fileName);

    public List<MixFileIndexEntry> getFileList();

    public List<String> getFileNameList();

    public MixInfo getMixInfo();
}